from django.test import TestCase
import jwt

# 编码
# jwt.encode(payload,key,HS256)
# token = jwt.encode({'uid': 3}, "1234", algorithm="HS256")
# # print(token)
# #
# # # 解码
# # # jwt.decode(token,key,algorithms)
# # payload = jwt.decode(token, "1234", algorithms=["HS256"])
# #
# # print(payload)

from ronglian_sms_sdk import SmsSDK


# SID = "8aaf070875e449d70175efa66a3f03c8"
#
# Token = "6ca1c1a4e4084a86989dc1dc7449c348"
#
# APPID = "8aaf070875e449d70175efa66b2103ce"
#
# sdk = SmsSDK(SID, Token, APPID)
# """
# 【云通讯】您的验证码是{1}，请于{2}分钟内正确输入
# """
# r = sdk.sendMessage(1, "18501219925", ("8899", "3"))
#
# print(r)

# # 生成随机验证码 :  右  4位或6位 数字组成
# import string
# import random
#
# r = random.sample(string.digits, 4)
# print("".join(r))
# print(string.ascii_letters)
# print(string.digits)
#
# from django.core.cache import cache
#
# cache.set("1110", "8899")
#
# print(cache.get("1110"))

class Person:
    name = "hello"


d = {}

d["dd"] = Person()

for key,value in d.items():
    print(key)
    print(value.name)
